package com.multithreading.Thread_001;

/**
 * @author zx
 * @version 1.0
 * @package_name: com.multithreading.Thread_001
 * @date 2024/5/13 17:23
 */
public class ThreadDemo {
    /**
     * 1.自定义一个类继承Thread类
     * 2.重写run方法
     * 3.创建子类的对象，并启动线程
     */
    public static void main(String[] args) {
        MyThread myThread001 = new MyThread();
        MyThread myThread002 = new MyThread();
        //线程命名
        myThread001.setName("线程1");
        myThread002.setName("线程2");
        // 启动线程
        myThread001.start();
        myThread002.start();
    }

}
